﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.DynamicProxy;
using RrslLite.Net.Messages;

namespace RrslLite.Configuration
{
    public class BatchCallBuilderConfiguration
    {
        private static object locker = "locker";

        public virtual Func<Guid, Message> MessageCreatorFunc { get; protected set; }


        public BatchCallBuilderConfiguration()
        {
            lock (locker)
            {
                Init();
            }
        }

        protected virtual void Init()
        {
            MessageCreatorFunc = (correlationId) => new Message(correlationId);
        }

        public virtual BatchCallBuilderConfiguration WithMessageCreator(Func<Guid, Message> messageCreatorFunc)
        {
            MessageCreatorFunc = messageCreatorFunc;

            return this;
        }
    }
}
